i=999
sumMax=i*2
answer_product=0
answer_a=0
answer_b=0
while i>1:
    for j in range(sumMax-999, 999):
        k=sumMax-j
        if k<=0:
            break
        product=i*j

        if product>=100000:
            if product%10==product/100000 and product%100/10==product/10000%10 and product%1000/100==product/1000%10:
                if product>answer_product:
                    answer_product=product
                    answer_a=j
                    answer_b=k
            continue
        if product>=10000:
            if product%10==product/10000 and product%100/10==product/1000%10:
                if product>answer_product:
                    answer_product=product
                    answer_a=j
                    answer_b=k
            continue
        if product>=1000:
            if product%10==product/1000 and product%100/10==product/100%10:
                if product>answer_product:
                    answer_product=product
                    answer_a=j
                    answer_b=k
            continue 
        if product>=100:
            if product%10==product/100:
                if product>answer_product:
                    answer_product=product
                    answer_a=j
                    answer_b=k
            continue 
        if product>=10:
            if product%10==product/10:
                if product>answer_product:
                    answer_product=product
                    answer_a=j
                    answer_b=k
            continue 
        if product>=1:
            if product>answer_product:
                answer_product=product
                answer_a=j
                answer_b=k
            continue 
    i-=1
    sumMax=i*2
print answer_product
print answer_a
print answer_b
